from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton

class MyWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('我的窗口')
        self.setGeometry(300, 300, 400, 300)

        btn = QPushButton('按钮', self)
        btn.setGeometry(100, 100, 200, 100)
        btn.clicked.connect(self.on_button_click)

    def on_button_click(self):
        print('按钮被点击了')

if __name__ == '__main__':
    app = QApplication([])
    window = MyWindow()
    window.show()
    app.exec()
